<template>
  <div class="home">

    <!--导航栏-->
    <van-nav-bar title="dhy外卖快送" left-text="" :left-arrow="leftArrow">
      <template #right>
        <van-icon name="search" size="18" />
      </template>
    </van-nav-bar>

    <router-view/>

    <!--底部导航栏-->
    <van-tabbar route>
      <van-tabbar-item  to="/home" icon="home-o">
        首页
      </van-tabbar-item>
      <van-tabbar-item  to="/list" icon="bars">
        订单
      </van-tabbar-item>
      <van-tabbar-item replace :to="isLogin" icon="https://b.yzcdn.cn/vant/icon-demo-1126.png">
        我的
      </van-tabbar-item>
    </van-tabbar>

  </div>
</template>

<script>

export default {
  name: 'Home',
  data(){
    return {
      leftArrow: false
    }
  },
  computed:{
    isLogin(){
      if(this.$store.state.isLogin === false){
        return '/login'
      }else{
        return '/host'
      }
    }
  }
}
</script>

<style>
  /*.my-swipe .van-swipe-item {*/
  /*  color: #fff;*/
  /*  font-size: 20px;*/
  /*  line-height: 150px;*/
  /*  text-align: center;*/
  /*  background-color: #39a9ed;*/
  /*}*/
</style>
